package exercise6;
public class Rectangle {
	private double width;
	private double height;
	private String color;
	public Rectangle() {};
	public Rectangle(double width,double height,String color) {
		this.width = width;
		this.height = height;
		this.color = color;
	}
	public double getWidth() {
		return width;
	}
	public void setWidth(double width) {
		this.width = width;
	}
	public double getHeight() {
		return height;
	}
	public void setHeight(double height) {
		this.height = height;
	}
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	public double findArea() {
		double area=this.width*this.height;
		return area;
	}
	public double findPerimeter() {
		double perimeter=(this.height+this.width)*2;
		return perimeter;
	}
	@Override
	public String toString() {
		return "矩形的宽为：" + getWidth() + ", 长为：" + getHeight() + ", 颜色为：" + getColor() + ", 面积为：为：" + findArea() + ", 周长为：" + findPerimeter();
	}
	
}
